package com.share.finance.collection.core.model.db;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 还款计划
 * </p>
 *
 * @author author
 * @since 2024-08-27
 */
@Data
@Accessors(chain = true)
@TableName("fun_repayment_plan")
public class RepaymentPlan implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 全局会话编号
     */
    @TableField(value = "session_id")
    private String sessionId;
    /**
     * 资金方返回的借据编号
     */
    @TableField(value = "due_bill_no")
    private String dueBillNo;

    /**
     * 产品编号
     */
    @TableField(value = "product_code")
    private String productCode;

    /**
     * 身份证号码
     */
    @TableField(value = "id_card")
    private String idCard;
    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private String userId;
    /**
     * 用户名称
     */
    private String name;
    /**
     * 手机号
     */
    @TableField(value = "phone_no")
    private String phoneNo;
    /**
     * 代扣银行卡号
     */
    @TableField(value = "bank_card")
    private String bankCard;
    /**
     * 代扣银行编码
     */
    @TableField(value = "bank_code")
    private String bankCode;
    /**
     * 账单时间
     */
    @TableField(value = "bill_time")
    private Date billTime;
    /**
     * 还款时间
     */
    @TableField(value = "repay_time")
    private Date repayTime;
    /**
     * 逾期开始时间
     */
    @TableField(value = "overdue_time")
    private Date overdueTime;
    /**
     * 还款期数-第几期数
     */
    private Integer term;
    /**
     * 每期还款本金[元]
     */
    @TableField(value = "repay_principal")
    private Double repayPrincipal;
    /**
     * 每期还款利息[元]
     */
    @TableField(value = "repay_interest")
    private Double repayInterest;
    /**
     * 逾期罚款利息[元]
     */
    @TableField(value = "overdue_interest")
    private Double overdueInterest;
    /**
     * 逾期天数
     */
    @TableField(value = "overdue_day")
    private Integer overdueDay;
    /**
     * 逾期状态：0-未逾期，1-已逾期
     */
    @TableField(value = "overdue_status")
    private Integer overdueStatus;
    /**
     * 逾期罚息年化利率
     */
    @TableField(value = "overdue_rate")
    private Double overdueRate;
    /**
     * 本期应还款总额=[每期还款本金+每期还款利息+罚息利息]
     */
    @TableField(value = "repay_total")
    private Double repayTotal;
    /**
     * 剩余贷还金额
     */
    @TableField(value = "remaining_amount")
    private Double remainingAmount;
    /**
     * 用户还款时间
     */
    @TableField(value = "pay_time")
    private Date payTime;
    /**
     * 还款状态：0-待还款，1-已还款
     */
    @TableField(value = "repay_status")
    private Integer repayStatus;
    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;
}
